class CreateJobs < ActiveRecord::Migration
  def self.up
    create_table :jobs do |t|
      t.string :name
      t.integer :rank
      
      t.timestamps
    end
    
    names = %w(fetch_reports parse_reports run_searches apply_autoscans release_batches clear_old_crawls)
    names.each_index{|i| Job.create(:name => names[i], :rank => i+1)}
  end

  def self.down
    drop_table :jobs
  end
end
